package com.spic.system.api;

import com.spic.common.core.constant.SecurityConstants;
import com.spic.common.core.constant.ServiceNameConstants;
import com.spic.common.core.web.domain.AjaxResult;
import com.spic.common.feign.FeignRequestInterceptor;
import com.spic.system.api.domain.ActTaskStartDto;
import com.spic.system.api.factory.RemoteActivitiFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author mos
 * @version 1.0
 * @description
 * @date 2021/10/11 17:49
 */
@FeignClient(contextId = "RemoteActivitiTaskService", value = ServiceNameConstants.SYSTEM_SERVICE, configuration = FeignRequestInterceptor.class, fallbackFactory = RemoteActivitiFallbackFactory.class)
public interface RemoteActivitiTaskService {
    @PostMapping("/task/start")
    AjaxResult startInstance(@RequestBody ActTaskStartDto actTaskStartDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/instance/history/list")
        // ?procInstId=xxx
    AjaxResult getHistoryInfoList(@RequestParam("procInstId") String procInstId);

    @GetMapping("/task/getMulitInstanceTask/{processInstanceId}/{definitonKey}")
    AjaxResult getMulitInstanceTask(@PathVariable("processInstanceId") String processInstanceId, @PathVariable("definitonKey") String definitonKey);

    @GetMapping("/task/getRunTaskInstanceTask/{processInstanceId}")
    AjaxResult getRunTaskInstanceTask(@PathVariable("processInstanceId") String processInstanceId);

}
